<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[%$softtitle%]</title>
<link href="templates/css/baselist.css" rel="stylesheet" type="text/css" />
<link href="templates/css/all.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/control.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<script type="text/javascript" src="js/dialog.js"></script>
<script type="text/javascript" language="JavaScript">
	var filemanage_js_upfile_zoomsize  = "[%$ST.filemanage_js_upfile_zoomsize%]";
	var filemanage_js_upfile_driname_err  = "[%$ST.filemanage_js_upfile_driname_err%]";
	var filemanage_js_upfile_ok = "[%$ST.filemanage_js_upfile_ok%]";
	var filemanage_js_upfile_no = "[%$ST.filemanage_js_upfile_no%]";
	$(window).load(function(){
		var h = $(window).height();
		$('#mainwindowhidden').css({height:h-39});
		var options = {
			beforeSubmit: formverify,
			success:saveResponse
		}
		$('#upfile').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
	});




	function formverify(formData, jqForm, options) {
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['upfilepath']=='') {
			document.upfile.upfilepath.focus();
			alert(filemanage_js_upfile_driname_err);
			return false;
		}
		if(get['img_issmallpic']==1) {
			if(get['img_width'].match(/^[1-9][0-9]+$/ig)==null || get['img_height'].match(/^[1-9][0-9]+$/ig)==null) {
				document.upfile.upfilepath.focus();
				alert(filemanage_js_upfile_zoomsize);
				return false;
			}
		}
	}

	function saveResponse(options){
		if (options=='true'){
			parent.refresh('filemodelattselectform','selectall','check_all');
			parent.closeifram();
			alert(filemanage_js_upfile_ok);
		}else{
			alert(options);
			parent.closeifram();
			
		}
	}
</script>
<!--[if IE 6]>
<style type="text/css" media="screen"> 
body { behavior:url("templates/css/csshover.htc");} 
</style> 
<![endif]-->
</head>

<body class="bodyflow">
<div class="centerrightwindow">
	<form name="upfile" id="upfile" method="post" enctype="multipart/form-data" action="index.php?archive=filemanage&action=upfilesave">
		<input type="hidden" name="path" id="path" value="[%$path%]"/>
		<input type="hidden" name="MAX_FILE_SIZE" id="maxfile" value="[%$maxfile%]">
		<div id="mainwindowhidden">
			<div class="suggestion">
				<span class="sugicon"><span class="strong colorgorning2">[%$ST.position_title%]</span><span class="padding-left5 colorgorningage">[%$ST.filemanage_file_upfile_dirname_mess%][%$maxfile2%]，[%$ST.filemanage_file_upfile_type_mess%][%$upfile_pictype%],[%$ST.filemanage_file_upfile_mess%][%$path%]</span></span>
			</div>
			<div class="sugtitle-line"></div>
			<div class="formdiv" id="filecheckmanger">
				<table border="0" width="100%">
					<tr class="trstyle2">
						<td class="trtitle01" width="20%">[%$ST.filemanage_file_upfile_dirname%]</td>
						<td class="trtitle02" width="80%"><input type="file" name="upfilepath" value="" maxlength="200" size="50" class="infoInput"></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.filemanage_file_upfile_zoom_type%]</td>
						<td class="trtitle02">
						<input type="radio" value="1" onclick="ondisplay('tableselect','trstyle2 displaytrue')" name="img_issmallpic"[%if $img_issmallpic==1%] checked[%/if%]> [%$ST.is_yes%]&nbsp;
						<input type="radio" value="0" onclick="ondisplay('tableselect','trstyle2 displaynone')" name="img_issmallpic"[%if $img_issmallpic==0%] checked[%/if%]> [%$ST.is_no%]
						</td>
					</tr>
					<tr class="trstyle2 [%if $img_issmallpic==1%]displaytrue[%else%]displaynone[%/if%]" id="tableselect">
						<td class="trtitle01">[%$ST.filemanage_file_upfile_zoom_size%]</td>
						<td class="trtitle02">
							<input type="text" name="img_width" value="[%$img_width%]" maxlength="20" size="5" class="infoInput"> /
							<input type="text" name="img_height" value="[%$img_height%]" maxlength="20" size="5" class="infoInput">
						</td>
					</tr>
				</table>
			</div>
		</div>
		<div id="downbotton">
			<div id="subbotton">
				<table border="0" width="100%">
					<tr id="bottonsubmit">
						<td id="right"><input type="submit" name="Submit" id="submitbotton" value="[%$ST.botton_upfile%]" class="buttonface" title="[%$ST.botton_upfile%]"/></td>
						<td id="left" class="padding-left5"><input type="reset" name="reset" onClick="javascript:parent.closeifram();" id="release" value="[%$ST.botton_upfile_reset%]" class="buttonface"  title="[%$ST.botton_upfile_reset%]" /></td>
					</tr>
				</table>
			</div>
		</div>
	</form>
</div>
</body>
</html>